package com.gitee.magic.jdbc.persistence.source.jdbc.sqlplus.conditions.update;

import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;

import com.gitee.magic.jdbc.persistence.source.jdbc.sqlplus.conditions.AbstractWrapper;
import com.gitee.magic.jdbc.persistence.source.jdbc.sqlplus.conditions.segments.MergeSegments;

/**
 * <p>
 * Delete 条件封装
 * </p>
 *
 * @author Start
 */
public class DeleteWrapper extends AbstractWrapper<String, DeleteWrapper> {

    public DeleteWrapper() {
        // 如果无参构造函数，请注意实体 NULL 情况 SET 必须有否则 SQL 异常
        this.initNeed();
    }

    private DeleteWrapper(AtomicInteger paramNameSeq,
                          Map<String, Object> paramNameValuePairs, MergeSegments mergeSegments) {
        this.paramNameSeq = paramNameSeq;
        this.paramNameValuePairs = paramNameValuePairs;
        this.expression = mergeSegments;
    }

    @Override
    protected String columnToString(String column) {
        return column;
    }

    @Override
    protected DeleteWrapper instance(AtomicInteger paramNameSeq, Map<String, Object> paramNameValuePairs) {
        return new DeleteWrapper(paramNameSeq, paramNameValuePairs, new MergeSegments());
    }
}
